from app01.models import Users, 年度合同, UserFields
from app01.utils.bootstrapmodelform import BootStrapModelForm


class UserForm(BootStrapModelForm):
    # password = forms.CharField(min_length=4, label="密码")
    class Meta:
        model = Users
        # fields = ['employeeid', 'name', 'password']  # 设置Users表中要显示的字段

        fields = '__all__'  # 所有字段
        # exclude = 'id' # 排除字段
        # widgets = {
        #     'employeeid': forms.TextInput(attrs={"class": "form-control"}),
        #     'name': forms.TextInput(attrs={"class": "form-control"}),
        #     'password': forms.PasswordInput(attrs={"class": "form-control", "minlength": "4"}),
        # }


class UserFieldsForm(BootStrapModelForm):
    class Meta:
        model = UserFields
        fields = '__all__'


class ContactYearForm(BootStrapModelForm):
    class Meta:
        model = 年度合同
        fields = '__all__'
